package cn.tedu.practice2303.TZ.day0408.homework;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) throws IOException {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入姓名");
        String name= scan.nextLine();
        System.out.println("请输入pwd");
        String pwd= scan.nextLine();
        System.out.println("请输入昵称");
        String nick= scan.nextLine();
        System.out.println("请输入年龄");
        int age= scan.nextInt();
        User p=new User(name,pwd,nick,age);
        FileOutputStream fis=new FileOutputStream(name+".obj",true);
        ObjectOutputStream oos=new ObjectOutputStream(fis);
        oos.writeObject(p);
        System.out.println("对象写出完毕");
        oos.close();





    }
}
